package com.example.demo.arithmetic.algorithm.recursion;


public class TestStackOverflow {
    public static void main(String[] args) {
        System.out.println(sum(22000));
    }

    public static int sum(int n) {

        if (n == 1) {
            return 1;
        }
        return sum(n - 1) + n;
    }

}
